<template>
    <van-sidebar v-model="activeKey" @change="Sendemit">
        <van-sidebar-item
            v-for="(item, index) in categoryList"
            :key="index"
            :title="item"
        />
    </van-sidebar>
</template>

<style scoped lang='stylus'  rel='stylesheet/stylus'>
    [class*=van-hairline]::after
        border-right-style: none
</style>
<script>
import { Sidebar, SidebarItem } from "vant";
export default {
    components: {
        vanSidebar: Sidebar,
        vanSidebarItem: SidebarItem
    },
    data: () => ({
        activeKey: 0
    }),
    props: {
        categoryList: Array
    },
    methods:{
        Sendemit(e){
            this.$emit("selectCategory",e)
        }
    }
};
</script>